home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.2 Development Libraries / SGI IRIX 6.2 Development Libraries.iso / dist / complib.idb / usr / share / catman / p_man / cat3 / complib / cscal2d.z / cscal2d
Text File  |  1996-03-14  |  7KB  |  133 lines

  1.  
  2.  
  3.  
  4. ccccssssccccaaaallll2222dddd,,,,zzzzssssccccaaaallll2222dddd((((3333FFFF))))                                        ccccssssccccaaaallll2222dddd,,,,zzzzssssccccaaaallll2222dddd((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ccccssssccccaaaallll2222dddd,,,, zzzzssssccccaaaallll2222dddd ---- scales a 2D complex sequence.
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
  12.      _F_o_r_t_r_a_n :
  13.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ccccssssccccaaaallll2222dddd(((( nnnn1111,,,, nnnn2222,,,, aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy,,,, llllddddaaaa))))
  14.           iiiinnnntttteeeeggggeeeerrrr     nnnn1111,,,, nnnn2222,,,, llllddddaaaa
  15.           rrrreeeeaaaallll        aaaallllpppphhhhaaaa
  16.           ccccoooommmmpppplllleeeexxxx     aaaarrrrrrrraaaayyyy((((llllddddaaaa,,,,nnnn2222))))
  17.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee zzzzssssccccaaaallll2222dddd(((( nnnn1111,,,, nnnn2222,,,, aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy,,,, llllddddaaaa))))
  18.           iiiinnnntttteeeeggggeeeerrrr     nnnn1111,,,, nnnn2222,,,, llllddddaaaa
  19.           rrrreeeeaaaallll****8888      aaaallllpppphhhhaaaa
  20.           ddddoooouuuubbbblllleeee ccccoooommmmpppplllleeeexxxx aaaarrrrrrrraaaayyyy((((llllddddaaaa,,,,nnnn2222))))
  21.  
  22.      _C :
  23.      ####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
  24.      iiiinnnntttt ccccssssccccaaaallll2222dddd((((iiiinnnntttt nnnn1111,,,,iiiinnnntttt nnnn2222,,,,ffffllllooooaaaatttt aaaallllpppphhhhaaaa,,,,
  25.                ccccoooommmmpppplllleeeexxxx ****aaaarrrrrrrraaaayyyy,,,,iiiinnnntttt llllddddaaaa))));;;;
  26.      iiiinnnntttt zzzzssssccccaaaallll2222dddd((((iiiinnnntttt nnnn1111,,,,iiiinnnntttt nnnn2222,,,,ddddoooouuuubbbblllleeee aaaallllpppphhhhaaaa,,,,
  27.                zzzzoooommmmpppplllleeeexxxx ****aaaarrrrrrrraaaayyyy,,,,iiiinnnntttt llllddddaaaa))));;;;
  28.  
  29.  
  30. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  31.      ccccssssccccaaaallll2222dddd and zzzzssssccccaaaallll2222dddd scale a 2D complex sequence of size N1xN2.
  32.      The Fourier Transforms are not normalized so the succession Direct-
  33.      Inverse transform scales the input data by a factor equal to the size of
  34.      the transform.  So ccccssssccccaaaallll2222dddd or zzzzssssccccaaaallll2222dddd may be used to scale back the
  35.      result.
  36.  
  37. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  38.      NNNN1111 ---- Integer, the first dimension size of the 2D sequence.
  39.      Unchanged on exit.
  40.  
  41.      NNNN2222 ---- Integer, the second dimension size of the 2D sequence.
  42.      Unchanged on exit.
  43.  
  44.      AAAAllllpppphhhhaaaa ---- scaling floating point value.
  45.  
  46.      AAAARRRRRRRRAAAAYYYY ---- Array containing the samples of the 2D sequence to be
  47.      transformed.
  48.      On input, the element {i,j} of the sequence is stored as A(i,j) in
  49.      _F_o_r_t_r_a_n , and A[i+j*lda] in _C.
  50.      On exit, the array is overwritten by its transform.  LLLLDDDDAAAA ---- Integer,
  51.      leading dimension: increment between the samples of two consecutive sub-
  52.      sequences (e.g between {i,j+1} and {i,j}).
  53.      Unchanged on exit.
  54.  
  55.  
  56. EEEExxxxaaaammmmpppplllleeee ooooffff CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee
  57.      Given a 2D complex sequence of size 64x1024.  We successively apply a
  58.      Direct Fourier Transform, an Inverse Fourier Transform and finally scale
  59.      back the result by a factor 1/N (1/(64*1024.))-
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ccccssssccccaaaallll2222dddd,,,,zzzzssssccccaaaallll2222dddd((((3333FFFF))))                                        ccccssssccccaaaallll2222dddd,,,,zzzzssssccccaaaallll2222dddd((((3333FFFF))))
  71.  
  72.  
  73.  
  74.      This succession DirectFFT-InverseFFT-Scaling is equivalent to the
  75.      identity operator and the final sequence should be equal (with round-off
  76.      precision) to the initial sequence.
  77.      The offset between the first element of two succesive sub-sequence
  78.      (leading dimension) is 2049.
  79.      _F_o_r_t_r_a_n
  80.           complex array(0:2049-1,0:64-1), coeff(1024+64+2*15)
  81.           call cfft2di( 1024, coeff)
  82.           call cfft2d( -1, 1024, 64, array, 2049, coeff)
  83.           call cfft2d(  1, 1024, 64, array, 2049, coeff)
  84.           call cscal2d(1024,64,(1./real(1024*64)),array,2049)
  85.  
  86.      _C
  87.           #include <fft.h>
  88.           complex array[64*2049], *coeff;
  89.           coeff = cfft2di( 1024, NULL);
  90.           cfft2d( -1, 1024, 64, array, 2049, coeff);
  91.           cfft2d(  1, 1024, 64, array, 2049, coeff);
  92.           cscal2d( 1024,64,1./(float)(1024*64),array,2049);
  93.  
  94.      NNNNOOOOTTTTEEEE____1111 :::: The Direct and Inverse transforms should use opposite signs -
  95.      Which one is used (+1 or -1) for Direct transform is just a matter of
  96.      convention-
  97.  
  98.      NNNNOOOOTTTTEEEE____2222 :::: The Fourier Transforms are not normalized so the succession
  99.      Direct-Inverse transform scales the input data by a factor equal to the
  100.      size of the transform.
  101.  
  102. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  103.      fft, cfft2di, zfft2di, cfft2d, zfft2d, cprod2d, zprod2d
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.